package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type SystemUserLevelRequest struct {
	MerId string `json:"mer_id" form:"mer_id"`

	Name string `json:"name" form:"name"`

	Money float64 `json:"money" form:"money"`

	ValidDate string `json:"valid_date" form:"valid_date"`

	IsForever bool `json:"is_forever" form:"is_forever"`

	IsPay bool `json:"is_pay" form:"is_pay"`

	IsShow bool `json:"is_show" form:"is_show"`

	Grade int64 `json:"grade" form:"grade"`

	Discount float64 `json:"discount" form:"discount"`

	Image string `json:"image" form:"image"`

	Icon string `json:"icon" form:"icon"`

	Explain string `json:"explain" form:"explain"`

	ExpNum int64 `json:"exp_num" form:"exp_num"`
}

func (r *SystemUserLevelRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *SystemUserLevelRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"name": "required",

		"money": "required",

		"is_pay": "required",

		"is_show": "required",

		"grade": "required",

		"discount": "required",

		"image": "required",

		"icon": "required",

		"explain": "required",

		"exp_num": "required",
	}
}

func (r *SystemUserLevelRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemUserLevelRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemUserLevelRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
